// smart 组件
import {
    connect
} from 'react-redux'
import ThemeSwitch from '../components/ThemeSwich'

const mapDispatchToProps = (dispatch) => {
    return {
        onSwitchColor: (color) => {
            dispatch({
                type: 'CHANGE_COLOR',
                themeColor: color
            })
        }
    }
}

const mapStateToProps = (state) => {
    return {
        themeColor: state.themeColor
    }
}

export default connect(
    mapStateToProps,
    mapDispatchToProps
)(ThemeSwitch)